<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        #box {
      width: 200px;
      height: 300px;
      margin:auto;
      background: url("1.JPG");
      position: relative;
    }

    .jd {
     font-size: 30px;
      position: absolute;
      width: 150px;
      height: 50px;
      text-align: center;
      line-height: 50px;
      color: #fff;
      left: 25px;
      top: 40px;
    }

    .hour {
      left: 20px;
    }

    .c {
      left: 68px;
    }

    .minute {
      left: 80px;
    }

    .c_s {
      right: 68px;
    }

    .second {
      left: 140px;
    }

    .hour,
    .minute,
    .second {
        font-weight: 800;
      font-size: 20px;
      text-align: center;
      line-height: 40px;
      width: 40px;
      height: 40px;
      background: black;
      position: absolute;
      top: 200px;
      color: #fff;
      
    }

    .c,
    .c_s {
      color: #fff;
      font-size: 20px;
      font-weight: 900;
      position: absolute;
      bottom: 70px;
    }

    .wz {
      color: white;
      margin-left: 20px;
      text-align: center;
      position: absolute;
      margin-top: 160px;
      font-size: 18px;
     
    }
    </style>
</head>
<body>
    <div id="box">
        <div class="jd">京东秒杀</div>
        <div class="wz"><strong>10:00</strong> 点场距结束</div>
        <div class="hour"></div>

        <span class="c">:</span>
        <div class="minute"></div>
        <span class="c_s">:</span>
        <div class="second"></div>
      </div>
    <script>
      var hour = document.querySelector(".hour");
  var minute = document.querySelector(".minute");
  var second = document.querySelector(".second");
  var inputTime = +new Date("2021-06-07 10:00:00");
  countDown();
 
  setInterval(countDown, 1000);

  function countDown() {
    var nowTime = +new Date(); 
    var times = (inputTime - nowTime) / 1000;
    var h = parseInt(times / 60 / 60 % 24);
    h = h < 10 ? '0' + h : h;
    hour.innerHTML = h;
    var m = parseInt(times / 60 % 60);
    m = m < 10 ? "0" + m : m;
    minute.innerHTML = m;
    var s = parseInt(times % 60);
    s = s < 10 ? "0" + s : s;
    second.innerHTML = s;
  }
    </script>
</body>
</html>